package com.appfahrt.persistence.obj.dbo.generated;

import java.util.ArrayList;

import com.appfahrt.persistence.obj.AbstractDatabaseObject;
import com.appfahrt.persistence.obj.dao.generated.LoginGeneratedDao;


/**
 * This Class is automatically generated.<br><br>
 *
 * <u><b>${schema}.login</b></u><br><br>
 * 
 * <u><b>Table Definition:</b></u>
 * <table> 
 *   <tr> <th>Column-Name</th> <th>Data-Type</th> <th>Data-Length</th> <th>Nullable</th> <th>Description</th> </tr> 
 *   <tr> <td>ID </td> <td>INTEGER</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>username </td> <td>VARCHAR</td> <td>16</td> <td>false</td> <td>-</td> 
 *   <tr> <td>passwort </td> <td>VARCHAR</td> <td>16</td> <td>false</td> <td>-</td> 
 *   <tr> <td>fk_id_profil </td> <td>integer</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>gesperrt </td> <td>boolean</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>faild_logins </td> <td>integer</td> <td>-1</td> <td>false</td> <td>-</td> 
 * </table>
 * <br><br>
 * <u><b>References:</b></u> <br>
 *
 * <br><br>
 * <u><b>Indexes:</b></u> <br>
 *
 * <br><b>DON'T MODIFY THIS FILE</b><br><br>
 *
 * Generated: Sun May 22 22:20:17 CEST 2011
 */
public abstract class LoginGeneratedDbo extends AbstractDatabaseObject {
	
	public static final String TABLE = "login";
	
	public static final String SCHEMA = "$schema";

	protected ArrayList<String> changedFieldList = new ArrayList<String>();
	
	private boolean loadFromDb = false;

	// Database Column-Definition
	public static final String ID = "id"; 
	public static final String username = "username"; 
	public static final String passwort = "passwort"; 
	public static final String fk_id_profil = "fk_id_profil"; 
	public static final String gesperrt = "gesperrt"; 
	public static final String faild_logins = "faild_logins"; 
	public final static String[] COLUMNS = {  ID , username , passwort , fk_id_profil , gesperrt , faild_logins  };

	// Members
			private Long Id = null;
				private String Username = null;
				private String Passwort = null;
				private Long FkIdProfil = null;
				private boolean Gesperrt = false;
				private Long FaildLogins = null;
	
	/** Value-Holder for the references **/
	private References references = new References();
	
	/**
	 * Value-Holder for the references.
	 */
	public class References {


	}

	/**
	 * Constructor.
	 */
	public LoginGeneratedDbo() {
	
	}
	
	
	/**
	 * Returns the references.
	 */
	public References getReferences() {
		return this.references;
	}
	
	/**
	 * Setter for <b>ID</b>  <br>
	 * Type: INTEGER <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setId(Long Id) {
				if (!(Id == null && this.Id == null) && !this.changedFieldList.contains("ID")) {
			this.changedFieldList.add("ID");
		}
		this.Id = Id ;
			}
	
	/**
	 * Getter for <b>ID</b>  <br>
	 * Type: INTEGER <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getId () {
		return this.Id;
	}
	
	/**
	 * Equals-Method for <b>ID</b>  <br>
	 * Type: INTEGER <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsId(Long Id) {
		boolean result = false;
				if (getId () != null
			&& getId ().equals( Id )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>username</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 16 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setUsername(String Username) {
				if (!(Username == null && this.Username == null) && !this.changedFieldList.contains("username")) {
			this.changedFieldList.add("username");
		}
		this.Username = Username ;
			}
	
	/**
	 * Getter for <b>username</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 16 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public String getUsername () {
		return this.Username;
	}
	
	/**
	 * Equals-Method for <b>username</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 16 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsUsername(String Username) {
		boolean result = false;
				if (getUsername () != null
			&& getUsername ().equals( Username )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>passwort</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 16 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setPasswort(String Passwort) {
				if (!(Passwort == null && this.Passwort == null) && !this.changedFieldList.contains("passwort")) {
			this.changedFieldList.add("passwort");
		}
		this.Passwort = Passwort ;
			}
	
	/**
	 * Getter for <b>passwort</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 16 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public String getPasswort () {
		return this.Passwort;
	}
	
	/**
	 * Equals-Method for <b>passwort</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 16 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsPasswort(String Passwort) {
		boolean result = false;
				if (getPasswort () != null
			&& getPasswort ().equals( Passwort )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>fk_id_profil</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setFkIdProfil(Long FkIdProfil) {
				if (!(FkIdProfil == null && this.FkIdProfil == null) && !this.changedFieldList.contains("fk_id_profil")) {
			this.changedFieldList.add("fk_id_profil");
		}
		this.FkIdProfil = FkIdProfil ;
			}
	
	/**
	 * Getter for <b>fk_id_profil</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getFkIdProfil () {
		return this.FkIdProfil;
	}
	
	/**
	 * Equals-Method for <b>fk_id_profil</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsFkIdProfil(Long FkIdProfil) {
		boolean result = false;
				if (getFkIdProfil () != null
			&& getFkIdProfil ().equals( FkIdProfil )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>gesperrt</b>  <br>
	 * Type: boolean <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setGesperrt(boolean Gesperrt) {
				this.Gesperrt = Gesperrt ;
			}
	
	/**
	 * Getter for <b>gesperrt</b>  <br>
	 * Type: boolean <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean getGesperrt () {
		return this.Gesperrt;
	}
	
	/**
	 * Equals-Method for <b>gesperrt</b>  <br>
	 * Type: boolean <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsGesperrt(boolean Gesperrt) {
		boolean result = false;
				result = getGesperrt ()==Gesperrt;
				return result;
	} 
	/**
	 * Setter for <b>faild_logins</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setFaildLogins(Long FaildLogins) {
				if (!(FaildLogins == null && this.FaildLogins == null) && !this.changedFieldList.contains("faild_logins")) {
			this.changedFieldList.add("faild_logins");
		}
		this.FaildLogins = FaildLogins ;
			}
	
	/**
	 * Getter for <b>faild_logins</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getFaildLogins () {
		return this.FaildLogins;
	}
	
	/**
	 * Equals-Method for <b>faild_logins</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsFaildLogins(Long FaildLogins) {
		boolean result = false;
				if (getFaildLogins () != null
			&& getFaildLogins ().equals( FaildLogins )) {
			result = true;
		}
				return result;
	} 

	/**
	 * Returns a short String with the values.
	 */
	public String toInfoShortString() {
		return  "[ID=" + this.Id+"]" +"-[username="+this.Username + "]" +"-[passwort="+this.Passwort + "]" +"-[fk_id_profil="+this.FkIdProfil + "]" +"-[gesperrt="+this.Gesperrt + "]" +"-[faild_logins="+this.FaildLogins + "]" ;
	}
	
	/**
	 * Returns a Comma-Separated Values (CSV) String. <br>
	 * Separator: ;
	 */
	public String toCsvString() {
		return toCsvString(";");
	}
	
	/**
	 * Returns a Comma-Separated Values (CSV) String
	 * with the given separator.
	 */
	public String toCsvString(String separator) {
		return  this.Id+separator+this.Username+separator+this.Passwort+separator+this.FkIdProfil+separator+this.Gesperrt+separator+this.FaildLogins;
	}
	
	/**
	 * Indicates whether the object has 
	 * changed or not.
	 */
	public boolean hasChanged() {
		return this.changedFieldList.size() > 0;
	}
	
	/**
	 * Changes Fields.
	 */
	public ArrayList<String> getChangedFieldList() {
		return this.changedFieldList;
	}
	
	/**
	 * Indicates, whether the object is new 
	 * or exists in the database.
	 */ 
	public boolean isNew() {
		return !loadFromDb;
	}
	
	/**
	 * Returns the name of the corresponding database table.
	 */
	public String getTable() {
		return TABLE;
	}
	
	/**
	 * Returns the name of the corresponding database schema.
	 */
	public String getSchema() {
		return SCHEMA;
	}
}